<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2021-10-19 10:20:44
 * @Description: 商品评论
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-10-19 17:44:09
 * @FilePath: /归档/base/2021_10_19_102044_create_good_comment.php
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateShopComments extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('good_comments', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->id();
            $table->foreignId('user_id')->default(0)->comment('用户ID');
            $table->foreignId('good_id')->default(0)->comment('商品ID');
            $table->foreignId('order_id')->default(0)->comment('订单ID');
            $table->integer('score')->default(5)->comment('评分');
            $table->string('title', 100)->comment('标题');
            $table->string('content', 255)->nullable()->comment('内容');
            $table->boolean('status')->default(1)->comment('1 正常，0 禁用');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('good_comments');
    }
}
